<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
//         1.将A5F3转成2进制
            var num=parseInt('A5F3',16)
            var res =num.toString(2)
            console.log(res);
//         2.99乘法表
            for (var i = 1; i <= 9; i++) {
                var sum=' ';
                for (let j = 1; j <= i; j++) {
                  
                  sum=sum+j+'*'+i+'='+(j*i)+'\t'
                }
                sum=sum+'<br>'
                  document.write(sum)
            }
//         3.输入年月，（用数组）
//           3.1.计算当月有多少天
//         3.2.计算还剩多少天
            var a=prompt('请输入年月日');
            var year=new Date(a).getFullYear();
            var month=new Date(a).getMonth();
            var day=new Date(a).getDate();
            const arr=[];
            if(year % 400 ==0 || (year % 4 ==0 && year%100 !=0)){
                arr=[31,29,31,30,31,30,31,30,31,30,31,30]
            }else{
                arr=[31,29,31,30,31,30,31,30,31,30,31,30]
            }
            alert('这个月有'+arr[month-1]+'天'+'  '+'这个月还剩'+(arr[month-1]-day)+'天');
    </script>
</body>
</html>